const BehaviorAll = require("../../../behaviors/behavior_all.js");
const BehaviorAddress = require("../../../template/address/behavior.js");
const ServiceScore = require("../../../service/service_score.js");

Component({
  /**
   * behaviors
   */
  behaviors: [BehaviorAll, BehaviorAddress],
  /**
   * 页面的初始数据
   */
  data: {
    allScore: 0,
    /**
     * 其它
     */
    startPage: 0,
  },

  methods: {
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
      const _this = this;
      // 加载数据
      ServiceScore.find(function (data) {
        _this.setData({
          allScore: data
        })
      })
      /* 地址配置 */
      _this.setData({
        b_address_addressDefaultGainFlag: false,
        //
        b_address_addressInfoShowFlag: false,
        b_address_addressInfoModifyShowFlag: false,
        b_address_addressInfoListShowFlag: false,
        //
        b_address_addressServiceCreateFlag: true,
        b_address_addressServiceModifyFlag: true,
        b_address_addressServiceDeleteFlag: true,
        //
        b_address_addressListStaticShowFlag: true,
        b_address_addressListShowFlag: true,
        b_address_addressListSelectShowFlag: false,
        b_address_addressListEditShowFlag: true,
        b_address_addressListDeleteShowFlag: true,
        //
        b_address_addressListRefreshInitedFlag: true,
        b_address_addressListRefreshCreatedFlag: true,
        b_address_addressListRefreshModifiedFlag: true,
      });
    },
    
    /**
     * 页面上拉触底事件的处理函数
     */
    // onReachBottom: function () {
    //   const _this = this;
    //   let startPage = _this.data.startPage + 1;
    //   ServiceAddress.page(_this.data.startPage, function (data) {
    //     _this.data.addresses.push(...data.records);
    //     _this.setData({
    //       addresses: _this.data.addresses,
    //       startPage: startPage
    //     });
    //   });
    // },

  }

})